package cn.ss.exam2302.web;

import cn.ss.exam2302.entity.JsonResult;
import cn.ss.exam2302.service.PaperService;
import cn.ss.exam2302.service.QuestionService;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class QuestionController {
    @Autowired
    private QuestionService questionService;

    @GetMapping("/question")
    @RequiresRoles("USER")
    @ResponseBody
    public JsonResult question(Integer paId, Integer pos){
        return questionService.query(paId, pos);
    }
}
